<?php 

$nums = [2, 4, 8, 16, 32];
$lans = ['PHP', 'Golang', 'JavaScript'];
var_dump($nums);
var_dump($lans);

$fruits = [];
$fruits[] = 'Apple';
$fruits[] = '123';
print_r($fruits);
echo '数组长度: ' . count($fruits);

$fruit = $fruits[0];
$fruits[2] = 'Banana';
print_r($fruit);
print_r($fruits);
unset($fruits[1]);
print_r($fruits);

$fruits = array_values($fruits);
print_r($fruits);

$book = [
    'Laravel精品课',
    '学院君',
    2020,
    99.0,
    false,
    true
];
print_r($book);

echo '<br/>关联数组<br/>';
echo 'PHP没有字典（map/dict），而是将其融入到数组中以关联数组方式提供<br/>';
$book = [
    'name' => 'Laravel精品课',
    'author' => '学院君',
    'publish_at' => 2020,
    'price' => 99.0,
    'published' => true,
    '掌握 Laravel 和 Vue 技术栈，成为合格的PHP 全栈工程师！',
    'https://xueyuanjun.com/books/master-laravel',
];
print_r($book);
$name = $book['name'];
$book['price'] = 199.0;
unset($book['price']);
print_r($name);
echo '<br/>';
print_r($book);